#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
unordered_map<long long , int> h;
int main() {
    int n, q;
    cin >> n >> q;
    vector<int> ret;
    while(q--) {
        int t;
        cin >> t;
        if(t == 1) {
            int i, j, k;
            cin >> i >> j >> k;
            h[i * 100000 + j] = k;
        }else {
            int i, j;
            cin >> i >> j;
            ret.push_back(h[i * 100000 + j]);
        }
    }
    for(auto& s : ret) {
        cout << s << endl;
    }
    return 0;
}